package com.zhengxin.one.controller;

import com.zhengxin.one.common.Result;
import com.zhengxin.one.service.impl.BillServiceipml;
import com.zhengxin.one.service.impl.CompensateServiceIpml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "shangshebao")
public class IndexController {
    @Autowired
    CompensateServiceIpml compensateServiceIpml;
    @Autowired
    BillServiceipml billServiceipml;
    @RequestMapping(value = "getIndex",method = RequestMethod.GET)
    public Result index(@RequestParam String company_id){
       HashMap<String,Object> Tmap = new HashMap<String,Object>();
            //查找商保理赔
        String soInfo = compensateServiceIpml.getSoCompensate(company_id);
            //查找社保理赔
        String coInfo = compensateServiceIpml.getCoCompensate(company_id);
            //社保异常名单
        List<Map> soList =billServiceipml.getSoFail(company_id);
            //公积金异常名单
        List<Map> acList =billServiceipml.getAcFail(company_id);
            //商保异常名单
        List<Map> coList = billServiceipml.getCoFail(company_id);
        Tmap.put("numberSo",soInfo);
        Tmap.put("numberCo",coInfo);
        Tmap.put("society",soList);
        Tmap.put("accumulation",acList);
        Tmap.put("commercial",coList);
           return Result.success(Tmap);
    }
}
